<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2019/12/29
  Time: 8:59
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>出差申请</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link type="text/css" href="../layui/css/layui.css" rel="stylesheet">
    <script type="text/javascript" src="../layui/layui.js"></script>

    <script type="text/javascript">
        layui.use(['layer', 'form',"table","jquery"], function(){
            var layer = layui.layer
            var form = layui.form;
            var table=layui.table
            var $=layui.jquery

            form.on('submit(submitFilter)', function(data){
                //console.log(data.field) //当前容器的全部表单字段，名值对形式：{name: value}
                $.ajax({
                    url:"${pageContext.request.contextPath}/insertEvection",
                    data:data.field,
                    success:function (data) {
                        if (data.isAdd) {
                            //关闭弹出框
                            layer.msg('添加成功')
                        }else {
                            layer.open({
                                content:"输入有误,请重新输入"
                            });
                        }
                    }

                })
                return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
            });
            /*监听添加工具栏======end*/





        });

    </script>



</head>
<body>


<!--//添加表单-->
<form class="layui-form"  id="addform" lay-filter="formFilter"> <!-- 提示：如果你不想用form，你可以换成div等任何一个普通元素 -->
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">姓名:</label>
            <div class="layui-input-inline">
                <input type="text" name="name" lay-verify="required" placeholder="请输入申请人"  class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">部门:</label>
            <div class="layui-input-inline">
                <input type="text" name="department" lay-verify="required" placeholder="请输入部门"  class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">出差时间:</label>
            <div class="layui-input-inline">
                <input type="date" name="startdate"   class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">结束时间:</label>
            <div class="layui-input-inline">
                <input type="date" name="enddate"   class="layui-input">
            </div>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">出差地点:</label>
            <div class="layui-input-inline">
                <input type="text" name="site" lay-verify="required" placeholder="请输入天数"  class="layui-input">
            </div>
        </div>
        <div class="layui-inline">
            <label class="layui-form-label">交通工具:</label>
            <div class="layui-input-inline">
                <select name="vehicle">
                    <option value="">请选择类型</option>
                    <option value="汽车">汽车</option>
                    <option value="火车">火车</option>
                    <option value="飞机">飞机</option>
                </select>
            </div>
        </div>
    </div>



    <div class="layui-form-item">
        <label class="layui-form-label">出差事由:</label>
        <div class="layui-inline">
            <textarea name="thing" placeholder="请输入内容" class="layui-textarea"></textarea>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label">工作任务:</label>
        <div class="layui-inline">
            <textarea name="task" placeholder="请输入内容" class="layui-textarea"></textarea>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">借款金额:</label>
            <div class="layui-input-inline">
                <input type="text" name="money" lay-verify="required" placeholder="请输入申请人"  class="layui-input">
            </div>
        </div>

    </div>
    <hr>
    <div class="layui-form-item">
        <label class="layui-form-label">下一步审批人:</label>
        <div class="layui-inline">
            <select name="approver" lay-filter="type" id="type">
                <option value="">请选择</option>
                <option value="张三">张三</option>
                <option value="李四">李四</option>
            </select>
        </div>
    </div>
    <div class="layui-form-item">
        <div class="layui-input-block">
            <button class="layui-btn" lay-submit lay-filter="submitFilter">立即提交</button>
            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
        </div>
    </div>
    <!-- 更多表单结构排版请移步文档左侧【页面元素-表单】一项阅览 -->
</form>



</body>
</html>
